home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Bitmap / Include / BmpSel.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.0 KB  |  95 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                BmpSel.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef BMPSEL_H
  13. #define BMPSEL_H
  14.  
  15. // ----- FrameWork Includes -----
  16.  
  17. #ifndef FWSELECT_H
  18. #include "FWSelect.h"
  19. #endif
  20.  
  21. // ----- Graphic Includes -----
  22.  
  23. #ifndef FWRECSHP_H
  24. #include "FWRecShp.h"
  25. #endif
  26.  
  27. //========================================================================================
  28. //    Forward Declarations
  29. //========================================================================================
  30.  
  31. #if FW_LIB_EXPORT_PRAGMAS
  32. #pragma lib_export on
  33. #endif
  34. class FW_CLASS_ATTR FW_CGraphicContext;
  35. #if FW_LIB_EXPORT_PRAGMAS
  36. #pragma lib_export off
  37. #endif
  38.  
  39. class FW_CLASS_ATTR CBitmapPart;
  40. class FW_CLASS_ATTR CBitmapFrame;
  41.  
  42. //========================================================================================
  43. //    class CBitmapSelection
  44. //========================================================================================
  45.  
  46. class FW_CLASS_ATTR CBitmapSelection : public FW_CSelection
  47. {
  48. //----------------------------------------------------------------------------------------
  49. //    Initialization/Destruction
  50. //
  51. public:
  52.     CBitmapSelection(Environment* ev, CBitmapPart* thePart);
  53.     virtual         ~CBitmapSelection();
  54.     
  55. //----------------------------------------------------------------------------------------
  56. //    Inherited API
  57. //
  58. public:
  59.     virtual void        CloseSelection(Environment* ev);
  60.     virtual void        SelectAll(Environment* ev);
  61.     virtual FW_Boolean    IsEmpty(Environment* ev) const;
  62.     
  63.     virtual void        DoExternalizeSelection(Environment* ev, 
  64.                                 ODStorageUnit* destinationSU,
  65.                                 FW_CCloneInfo* cloneInfo);
  66.     virtual FW_Boolean    DoInternalizeSelection(Environment* ev, 
  67.                                 ODStorageUnit* sourceSU,
  68.                                 FW_CCloneInfo* cloneInfo);
  69.  
  70.     virtual ODShape*    CreateSelectionFrameShape(Environment* ev) const;
  71.     virtual ODShape*    CreateSelectionShape(Environment* ev, ODFacet* facet, FW_CFrame* frame) const;
  72.                                 
  73. //----------------------------------------------------------------------------------------
  74. //    New API
  75. //
  76. public:
  77.     void                GetSelectRect(const FW_CPoint& ratio, const FW_CRect& usedRect, FW_CRect& rect) const;
  78.     void                SetSelectRect(const FW_CPoint& ratio, const FW_CRect& usedRect, const FW_CRect& rect);
  79.     void                SetSelectRect(const FW_SPlatformRect& rect);
  80.     
  81.     void                MoveAnts(Environment* ev, CBitmapFrame* frame);
  82.     void                DrawAnts(Environment* ev, CBitmapFrame* frame);
  83.     void                DoDrawAnts(Environment* ev, FW_CGraphicContext& fc, CBitmapFrame* frame);
  84.         
  85. //----------------------------------------------------------------------------------------
  86. //    Data Members
  87. //
  88. private:
  89.     CBitmapPart*        fBitmapPart;
  90.     FW_SPlatformRect    fSelectRect;    // it is a FW_SPlatformRect because it is in pixels
  91.     FW_Boolean            fHasSelection;
  92.     FW_CRectShape        fRectShape;
  93. };
  94.  
  95. #endif